package com.lovo.controller;


import com.lovo.bean.Ordergoods;
import com.lovo.service.IOrdergoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * ??????Ʒ? 前端控制器
 * </p>
 *
 * @author lovo
 * @since 2022-09-17
 */
@RestController
@RequestMapping("hd/ordergoods")
public class OrdergoodsController {

    @Autowired
    private IOrdergoodsService ordergoodsService;

    @GetMapping("/findAllOrderGoods/{orderId}")
    public List<Ordergoods> findAllOrderGoods(@PathVariable("orderId") Integer orderId) {
        return ordergoodsService.findAllOrderGoods(orderId);
    }

    @GetMapping("/addOrderGoods")
    public String addOrderGoods(Ordergoods ordergoods) {
        ordergoodsService.addOrderGoods(ordergoods);
        return "ok";
    }

}
